<!-- 详情页 -->
<template>
    <div>
        <detail-banner 
			:sightName="sightName"
			:bannerImg="bannerImg"
			:gallaryImgs="gallaryImgs"
		></detail-banner>  
        <detail-header></detail-header> 
        <detail-list :list="categoryList"></detail-list>  
    </div>
</template>

<script>
import DetailHeader from './components/Header'
import DetailBanner from './components/Banner'
import DetailList from './components/List'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailHeader,
    DetailBanner,
    DetailList
  },
  data() {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  methods: {
    getDetailInfo() {
      axios
        .get('/api/detail.json', {
          params: {
            id: this.$route.params.id
          }
        })
        .then(this.getDetailSucc)
    },
    getDetailSucc(res) {
      res = res.data
      if (res.status) {
        const rs = res.data
        this.sightName = rs.sightName
        this.bannerImg = rs.bannerImg
        this.gallaryImgs = rs.gallaryImgs
        this.categoryList = rs.categoryList
      }
    }
  },
  activated() {
    this.getDetailInfo()
  }
}
</script>

<style lang="stylus" scoped>
</style>

